package com.controller;


import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.util.DbUtil;

@WebServlet("/view/StudentServlet")
public class StudentServlet extends HttpServlet {

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String account = request.getParameter("account");
		String name = request.getParameter("name");
		String sex = request.getParameter("sex");
		String clazz = request.getParameter("clazz");
		String specialty = request.getParameter("specialty");
		String college = request.getParameter("college");
		String sql = "update t_student set name = '" + name + "', sex = '" + sex + "', clazz = '" + clazz + "', specialty = '" + specialty + "', college = '" + college + "' where account = '" + account + "'";
		DbUtil.add_modify(sql);
		request.setAttribute("rs", "操作成功。");
		request.getRequestDispatcher("/view/student_info.jsp").forward(request, response);
	}
}
